
public class ABCluster extends ClusterBase {
    private String pro = "Header:";

    public String getKey(int aid){
        return pro + String.valueOf(aid);
    }

    public int insert(int aid, int bid){
        int ret = 0;
        try {
            getJedisCluster().set(getKey(aid), String.valueOf(bid));
        } catch (Exception e) {
            // TODO: handle exception
            e.printStackTrace();
            ret = 1;
        }
        return ret;
    }

    public int getB(int aid){
        int ret = 0;
        try {
            String value = getJedisCluster().get(getKey(aid));
            ret = Integer.parseInt(value);
        } catch (Exception e) {
            // TODO: handle exception
            e.printStackTrace();
            ret = 0;
        }
        return ret;
    }
}
